#pragma once
#include "../Misc/resource.h"
#include "../Disks/DiskMgmt.h"

class CMainDlg:
	public CDialogImpl<CMainDlg>
{
public:
	inline CMainDlg() { }
	inline ~CMainDlg() { }

	const UINT IDD = IDD_DISKS;

	BEGIN_MSG_MAP( CMainDlg )
		MESSAGE_HANDLER( WM_INITDIALOG, onInitDialog );
		COMMAND_ID_HANDLER( IDOK, actOK );
		COMMAND_ID_HANDLER( IDCANCEL, actCancel );
	END_MSG_MAP()

	HRESULT initialize( IVdsService *pService );
private:

	CComboBox m_cb;
	CListViewCtrl m_list;

	LRESULT onInitDialog( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );

	LRESULT actOK( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled );

	LRESULT actCancel( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
	{
		EndDialog( IDCANCEL );
		return 0;
	}

	CAtlArray<CComPtr<IVdsDisk>> m_drives;
	CAtlArray<sDiskInfo> m_info;
	int m_selectedIndex;
};